{	Problem: http://codeforces.ru/problemset/problem/22/A
	Verdict: Accepted

}
var n,i:integer; a:array[1..101] of integer;
procedure qsort(l,r:integer);
var i,j,x,y:integer;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
  while a[i]<x do inc(i);
  while a[j]>x do dec(j);
  if i<=j then begin
    y:=a[i];
    a[i]:=a[j];
    a[j]:=y;
    inc(i);
    dec(j);
  end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
readln(n);
for i:=1 to n do read(a[i]);
qsort(1,n);
i:=2;
while (a[i]=a[i-1]) and (i<=n) do inc(i);
if i<=n then writeln(a[i]) else writeln('NO');
end.